

<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'user.label', default: 'User')}" />
  <title><g:message code="default.create.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
	<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
	<span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
	<h1><g:message code="default.create.label" args="[entityName]" /></h1>
	<g:if test="${flash.message}">
	  <div class="message">${flash.message}</div>
	</g:if>
	<g:hasErrors bean="${userInstance}">
	  <div class="errors">
		<g:renderErrors bean="${userInstance}" as="list" />
	  </div>
	</g:hasErrors>
	<g:form action="saveall" method="post" >
	  <div class="dialog">
		<table>
		  <tbody>

			<tr class="prop">
			  <td valign="top" class="name">
				<label for="userName">Users</label>
			  </td>
			  <td valign="top" class="value ${hasErrors(bean: userInstance, field: 'userName', 'errors')}">
			  <g:textArea name="userInfos" value="hh" />
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="password"><g:message code="user.password.label" default="Password" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: userInstance, field: 'password', 'errors')}">
			  <input type="password" maxlength="16" id="password" name="password" value="${userInstance?.password}"/>
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="department"><g:message code="user.department.label" default="Department" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: userInstance, field: 'department', 'errors')}">
			<g:select name="department" from="${departmentMap}" noSelection="${['null':'请选择...']}" optionKey="key" optionValue="value"/>
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="maxAnswers"><g:message code="user.maxAnswers.label" default="Max Answers" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: userInstance, field: 'maxAnswers', 'errors')}">
			<g:textField name="maxAnswers" maxlength="16" value="${userInstance?.maxAnswers}" />
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="firstName"><g:message code="user.roles.label" default="Roles" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: userInstance, field: 'roles', 'errors')}">
		  <g:each in="${Role.findAll()}" var="role">
			<g:checkBox name="selectedRoles" value="${role.id}" checked=""/>${role.roleName}<BR/>
		  </g:each>
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="creationTime"><g:message code="user.creationTime.label" default="Creation Time" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: userInstance, field: 'creationTime', 'errors')}">
		  <gext:datePicker name="creationTime" precision="day" value="${userInstance?.creationTime}" />
		  </td>
		  </tr>

		  </tbody>
		</table>
	  </div>
	  <div class="buttons">
		<span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
	  </div>
	</g:form>
  </div>
</body>
</html>
